public class Work6 {
    public static void main(String[] args) {
        int[] array = {2, 2, 1, 3, 4, 3, 1};
        int answer = 0;
        for (int x : array) {
            answer = answer ^ x;
        }
        System.out.println(answer);
    }
}
